package org.jxf.gps.jfinal.model;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.jfk.core.utils.GeoPoint;

public class FenceRectangle extends Fence implements IFenceAssert{
	private double[] ne,sw;
	

	public double[] getNe() {
		return ne;
	}

	public void setNe(double[] ne) {
		this.ne = ne;
	}

	public double[] getSw() {
		return sw;
	}

	public void setSw(double[] sw) {
		this.sw = sw;
	}

	@Override
	public boolean isIn(GeoPoint p) {
		
		return false;
	}

	@Override
	public boolean isOut(GeoPoint p) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isOn(GeoPoint p) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isMoveIn(GeoPoint curr, GeoPoint last) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isMoveOut(GeoPoint curr, GeoPoint last) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void loadDetail(String fenceDetail) {
		JSONObject j = JSONObject.fromObject(fenceDetail);
		this.setType(j.getString("type"));
		JSONObject dl = j.getJSONObject("detail");
		
		JSONArray c1 = dl.getJSONArray("ne");
		ne = new double[2];
		ne[0] = c1.getDouble(0);
		ne[1] = c1.getDouble(1);

		JSONArray c2 = dl.getJSONArray("sw");
		sw = new double[2];
		sw[0] = c2.getDouble(0);
		sw[1] = c2.getDouble(1);
		
	}
	



}
